<?php
header("Content-type: image/png");
include ('habboClass.php');
$habbo = $_GET['name'];
//Data Retrieval
$habboHome = new habboClass($habbo, 'com.au');

if ($habboHome->banned())
{
    $im = imagecreatefrompng("banned.png");
}
elseif ($habboHome->pageprivate())
{
    $im = imagecreatefrompng("private.png");
}
elseif (!$habboHome->actual())
{
    $im = imagecreatefrompng("exist.png");
}
else
{
    $im = imagecreatefrompng("profile.png");

    $white = imagecolorallocate($im, 255, 255, 255);
    $fontbold = "volterb.ttf";
    $font = "volter.ttf";

    imagettftext($im, 7, 0, 103.5, 28.5, $white, $fontbold, "Name:");
    imagettftext($im, 7, 0, 149.5, 28.5, $white, $font, $habboHome->name());

    $habboMotto = $habboHome->motto();
    $habboMotto = eregi_replace("&gt;", ">", $habboMotto);
    $habboMotto = eregi_replace("&lt;", "<", $habboMotto);
    imagettftext($im, 7, 0, 103.5, 58.5, $white, $fontbold, "Motto:");
    imagettftext($im, 7, 0, 149.5, 58.5, $white, $font, $habboMotto);

    if ($habboHome->online())
    {
        $statusText = "Online";
    }
    else
    {
        $statusText = "Offline";
    }
    imagettftext($im, 7, 0, 240, 89, $white, $fontbold, "Status:");
    imagettftext($im, 7, 0, 290, 89, $white, $font, $statusText);
    $habboFigure = $habboHome->figure();
    $habboFigure = imagecreatefromgif($habboFigure);
    imagecopy($im, $habboFigure, 16, 18.5, 0, 0, 64, 106);
if($habboHome->badge()){
    $habboBadge = $habboHome->badge();
    $habboBadge = imagecreatefromgif($habboBadge);
    $halfBadgeX = imagesx($habboBadge) / 2;
    $halfBadgeY = imagesy($habboBadge) / 2;
    $centerX = 127.5 - $halfBadgeX;
    $centerY = 110.5 - $halfBadgeY;
    imagecopy($im, $habboBadge, $centerX, $centerY, 0, 0, imagesx($habboBadge),
        imagesy($habboBadge));

if($habboHome->groupbadge()){
    $habboBadge = $habboHome->groupbadge();
    $habboGBadge = imagecreatefromgif($habboBadge);
    $halfGBadgeX = imagesx($habboGBadge) / 2;
    $halfGBadgeY = imagesy($habboGBadge) / 2;
    $centerX = 193.5 - $halfGBadgeX;
    $centerY = 110.5 - $halfGBadgeY;
    imagecopy($im, $habboGBadge, $centerX, $centerY, 0, 0, imagesx($habboGBadge),
        imagesy($habboGBadge));


}

}

}

//Create Image
imagepng($im);
imagedestroy($im);
?>